import * as Y from 'yjs';
import { WebsocketProvider } from 'y-websocket';
import { useQuery } from '@tanstack/react-query';
import  type { User } from "@/types/api";
import { DocView } from "@doc/shadcn";

interface DocEditorProps {
    pageId: string;
    initialContent?: string;
    doc:Y.Doc
    provider:WebsocketProvider
}
export function DocEditor(props: DocEditorProps) { 
    const { pageId, doc, provider } = props
    const { data:currentUser} = useQuery<User>({
        queryKey: ['currentUser'],
    })
    console.log("currentUser:",currentUser);
    console.log("pageId:",pageId);
    console.log("doc:",doc);
    console.log("provider:",provider);
    // <DocView/>
    return (<div><DocView/></div>)
}